package com.liangzhong.model.goods.vo
{
	import com.common.stdlib.StringUtil;
	import com.global.GlobalDef;
	import com.liangzhong.model.type.GoodsType;
	import com.liangzhong.model.type.MaterialType;

	/**
	 *材料 
	 * @author lake
	 * 
	 */	
	public class MaterialVo extends GoodsVo
	{
		/**
		 * 材料ID
		 */		
		public var stuffid 			:int;
		/**
		 * 材料名字
		 */		
		public var stuffname 		:String;
		/**
		 * 成色
			1.	球魂
			2.	球衣碎片
			3.	洗练卡
		 */		
		//public var ntype 			:int;
		
		public function MaterialVo()
		{
			super();
		}
		/**
		 *解析数据 
		 * @param data
		 * 
		 */		
		override public function parse(data :Object):void
		{
			var xmlList:XMLList = data.children();
			for each(var xml:XML in xmlList)
			{
				if(this.hasOwnProperty(xml.localName()))
				{
					this[xml.localName()] = xml.toString();
				}
			}
			name 	= stuffname;
			url  	= GlobalDef.Web_Res_Url + "prop/" + header;
			type 	= GoodsType.MATERIAL;
			pid 	= stuffid;
			gid		= stuffid;
		}
		/**
		 *获取tips 显示信息 
		 * @return 
		 * 
		 */		
		override public function get tipsInfo():String
		{
			var info :String = super.tipsInfo;
			descplay = descplay.replace("在研究所中使用","");
			descplay = descplay.replace(/！/gi,"");
			descplay = StringUtil.trim(descplay);
			info += "<p align='left'>" + descplay + "</p>\n";
			var mName :String = "";
			switch(ntype)
			{
				case MaterialType.STAR_SOUL:
				case MaterialType.TRIKOT_CHIP:
				{
					mName = "-->材料合成，球衣合成";
					break;
				}
				case MaterialType.FRESH_CARD:
				{
					mName = "-->材料合成，角色强化";
					break;
				}
			}
			info +="<p align='left'><font color='#33ccff'>在科技馆"+mName+"中使用</font>";
			return info;
		}
	}
}